package com.xiangyang.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiangyang.entity.Perms;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface IPermsMapper extends BaseMapper<Perms> {
    @Select("select perm from perms t1 \n" +
            "inner join perms_role t2 on t1.perms_id=t2.Permissions_id\n" +
            "inner join role t3 on t3.role_id=t2.role_id\n" +
            "inner join user t4 on t4.user_type=t3.role_id\n" +
            "where t4.user_id=#{roleId}")
    List<String> getPermsByRoleId(Long roleId);

}
